﻿<%@ Page Language="C#" AutoEventWireup="true" ClientIDMode="Static" CodeBehind="Login.aspx.cs" Inherits="CoolERP_Web.Login" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>ERP管理平台</title>
    <link href="Styles/Site.css" rel="stylesheet" type="text/css" />
    <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script src="Scripts/common.js" type="text/javascript"></script>
    <script src="Scripts/jquery.mapkey.min.js" type="text/javascript"></script>
    <script src="Scripts/LockKeyboard.js" type="text/javascript"></script>
<style type="text/css">
body {color: #528311; font-size: 12px;}
.input{height: 18px; width: 130px; border: solid 1px #cadcb2; font-size: 12px; color: #81b432;}
</style>
<script type="text/javascript">
    $(function () {
        if ($("#hidType").val() == "2") { KeyF8(); document.getElementById("tbName").blur(); }
        $.mapKey("f7", function () { KeyF7(); $("#lbResult").text(""); });
        $.mapKey("f8", function () { KeyF8(); $("#lbResult").text(""); });
        $.mapKey("enter", function () { document.getElementById("imgLogin").click(); });
        tipObj = document.getElementById("lbResult");
    });
    function KeyF7() {
        $("#tbName").val("");
        $("#tbPassword").val("");        
        $("#trPwd").show();
        $("#divTips").text("按键盘F8转换为扫描输入");
        $("#hidType").val("1");
        $("#tbName").unbind("keyup");
    }
    function KeyF8() {
        $("#tbName").val("");
        $("#tbPassword").val("");
        $("#trPwd").hide();
        $("#divTips").text("按键盘F7转换为键盘输入");
        $("#hidType").val("2");
        document.getElementById("tbName").focus();
        $("#tbName").bind("keyup", function () { lockInput(this); });
    }
    function setReset() { document.forms[0].reset(); }
    function checkSubmit() {
        if (isEmpty($("#tbName").val())) {
            alert("请输入用户名");
            return false;
        }
        if ($("#hidType").val() == "1" && isEmpty($("#tbPassword").val())) {
            alert("请输入密码");
            return false;
        }
    }
</script>
</head>
<body>
    <form id="form1" runat="server"><asp:HiddenField ID="hidType" runat="server" Value="1" />
    <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
        <tr><td bgcolor="#e5f6cf"></td></tr>
        <tr>
            <td style="background:url(Images/Login/login_03.gif); height:608px">
                <table width="862" border="0" align="center" cellpadding="0" cellspacing="0">
                    <tr><td colspan=3 style="background:url(Images/Login/login_04.gif); height:266px">
                        <div id="divTips" style="margin:240px 0px 0px 440px; text-align:left;">按键盘F8转换为扫描输入</div>
                    </td></tr>
                    <tr>
                        <td style="background:url(Images/Login/login_06.gif); width:424px; height:95px"></td>
                        <td style="background:url(Images/Login/login_07.gif); width:183px">
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td width="21%" height="30"><div align="center"><span class="STYLE3">用户</span></div></td>
                                    <td width="79%" height="30"><asp:TextBox ID="tbName" runat="server" CssClass="input"/></td>
                                </tr>
                                <tr id="trPwd">
                                    <td height="30"><div align="center"><span class="STYLE3">密码</span></div></td>
                                    <td><asp:TextBox ID="tbPassword" runat="server" CssClass="input" MaxLength="16" TextMode="Password"/></td>
                                </tr>
                                <tr>
                                    <td height="30"></td>
                                    <td><div id="divLogin"><asp:ImageButton ID="imgLogin" runat="server" ImageUrl="~/Images/Login/login.gif" OnClick="imgLogin_Click" OnClientClick="return checkSubmit();" /><img src="Images/Login/reset.gif" onclick="setReset();" style="cursor:pointer" /></div></td>
                                </tr>
                            </table>
                        </td>
                        <td style="background:url(Images/Login/login_08.gif); width:255px"></td>
                    </tr>
                    <tr>
                        <td colspan=3 valign=top style="background:url(Images/Login/login_09.gif); height:247px">
                            <div align=center style="height:30px;line-height:30px;">
                            <asp:Label ID="lbResult" runat="server" ForeColor="Red" style="margin-left:80px"/></div>
                            <div align=center style="color: #42870a; font-size: 12px; line-height:30px; padding-left:10px">版本 2011V1.0</div>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr><td bgcolor="#a2d962"></td></tr>
    </table>
    </form>
</body>
</html>
